<%@LANGUAGE="VBSCRIPT" CODEPAGE="1251"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Untitled Document</title>
</head>
<!--#include file="../Connect/Connection.asp"-->
<!--#include file="../Connect/adovbs.inc"-->
<body>
<%
IF Request.Form("slSluice")>0 THEN
	strCompl=request.QueryString("Compl")
	Set cnn=Server.CreateObject("adoDB.connection")
	cnn.open connStr & ";Initial Catalog=i_dealer"
	
	Set rs=Server.CreateObject("ADODB.Recordset")
	sSQL = "[Sluice].[usp_GetGoodsOutsideOfSluices] '" & Request.Form("slSluice") & "'"
	rs.Open sSQL, cnn, 1

	Response.Write "<script language=""JavaScript"" type=""text/JavaScript"">" & vbNewLine
	Response.Write "	var obj=parent.document.getElementById('slGoods'); " & vbNewLine
	Response.Write "	obj.options.length = 0;" & vbNewLine
	Response.Write "	parent.document.getElementById('trEmpty').style.display='none';" & vbNewLine
	Response.Write "	parent.document.getElementById('trGoods').style.display='block';" & vbNewLine
	Response.Write "	parent.frm.btnAdd.disabled=false;" & vbNewLine
	Response.Write "	parent.document.getElementById('trWait').style.display='none';" & vbNewLine	
	IF NOT rs.eof THEN
		i=0
		DO WHILE NOT rs.eof
			i=i+1
			Response.Write "var op" & i & "=parent.document.createElement('option'); " & vbNewLine
			Response.Write "op" & i & ".value='" & rs("Code") & "';" & vbNewLine
			Response.Write "op" & i & ".innerHTML='" & rs("Code") & "';" & vbNewLine
			Response.Write "obj.appendChild(op" & i & ");" & vbNewLine
			rs.MoveNext
		LOOP
	END IF
		Response.Write "</script>" & vbNewLine	
	rs.Close
	Set rs=Nothing
ELSEIF Request.Form("slSluice")=0 THEN
	Response.Write "<script language=""JavaScript"" type=""text/JavaScript"">" & vbNewLine
	Response.Write "	var obj=parent.document.getElementById('slGoods'); " & vbNewLine
	Response.Write "	obj.options.length = 0;" & vbNewLine
	Response.Write "	parent.document.getElementById('trEmpty').style.display='block';" & vbNewLine
	Response.Write "	parent.document.getElementById('trGoods').style.display='none';" & vbNewLine
	Response.Write "	parent.frm.btnAdd.disabled=true;" & vbNewLine
	Response.Write "	parent.document.getElementById('trWait').style.display='none';" & vbNewLine	
	Response.Write "</script>" & vbNewLine	
END IF
%>
</body>
</html>
